import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), tailwindcss(),],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  server: {
    host: "0.0.0.0",
    proxy: {
      // 配置代理规则
      '/api': {
        target: 'http://192.168.8.100:8988', // 目标服务器地址
        changeOrigin: true, // 更改请求头中的 Host
        rewrite: (path) => path.replace(/^\/api/, ''), // 重写路径
      },
    },
  },
})
